﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace 桌面视频录制
{
    [Serializable]
    public abstract class DrawObject
    {
        protected Color penColor;
        public Color PenColor
        {
            get { return penColor; }
            set 
            { 
                penColor = value;
                this.DrawBrush = new SolidDrawBrush(penColor);
            }
        }
        protected float penWidth;

        public float PenWidth
        {
            get { return penWidth; }
            set { penWidth = value; }
        }

        protected Point mouseDownPoint;

        public Point MouseDownPoint
        {
            get { return mouseDownPoint; }
            set { mouseDownPoint = value; }
        }
        protected string id;

        public string Id
        {
            get { return id; }
            set { id = value; }
        }
        protected DrawBrush drawBrush;

        public DrawBrush DrawBrush
        {
            get { return drawBrush; }
            set { drawBrush = value; }
        }
        protected string displayText;

        public string DisplayText
        {
            get { return displayText; }
            set { displayText = value; }
        }
        protected DrawObject()
        {
            DateTime now = DateTime.Now;
            this.id = StaticFunction.GetHostIP().ToString() + "@" + now.ToLongTimeString() + "@" + now.Millisecond;
            this.penColor = Color.Black;
            this.penWidth = 1.0f;
            this.DrawBrush = new SolidDrawBrush(this.penColor);
        }
        public abstract void Draw(Graphics g);

        public abstract void MouseMove(System.Windows.Forms.MouseEventArgs e);

        public abstract bool JudgeIsSelected(System.Windows.Forms.MouseEventArgs e);

        public abstract void DrawControlPoint(Graphics g);

        public abstract void MoveLocation(System.Windows.Forms.MouseEventArgs e);

        public abstract bool JudgeIsInControlRegion(System.Windows.Forms.MouseEventArgs e);

        public abstract void ChangeSize(System.Windows.Forms.MouseEventArgs e);

        public abstract Rectangle GetRectangle();

        public abstract Point[] GetPoints();

        public abstract string GetDrawObjectMsg();

        public abstract bool IsAllInRectangle(Region region);

        public abstract DrawObject Clone(Point point);

        public abstract Point[] GetTextBoxLocation();
    }
}
